#ifndef CT_CONSTANTS_PRIME_CT_HPP
#define CT_CONSTANTS_PRIME_CT_HPP

#include <array>

constexpr bool odd_number_is_prime(unsigned long odd_number) {
    if(odd_number < 2) { return false; }
    for(unsigned long i=3; i*i <= odd_number; i+=2) {
        if(odd_number % i == 0 ) { return false; }
    }
    return true;
}

inline constexpr unsigned long N = 10000;

inline constexpr auto precomputed_primes = [](){
    std::array<unsigned long, N> primes{};
    primes[0] = 2;  // edge case
    unsigned long idx = 1;
    for (unsigned long num=3; idx<N; num+=2) {
        if (odd_number_is_prime(num)) {
            primes[idx++] = num;
        }
    }
    return primes;
}();

#endif //CT_CONSTANTS_PRIME_CT_HPP
